﻿package chapter_04_Homework;

public class Work_02_Pet {
	private String name = "无名氏";
	private int health = 100;
	private int love = 0;
	int avoirdupois = 2;
	protected String color;
	public int id = 1001;
	public Work_02_Pet(String name) {
		this.health = 95;
		System.out.println("执行宠物的无参构造方法。");
	}

	public Work_02_Pet() {
		// TODO 自动生成的构造函数存根
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getHealth() {
		return health;
	}
	public void setHealth(int health) {
		this.health = health;
	}
	public int getLove() {
		return love;
	}
	public void setLove(int love) {
		this.love = love;
	}
	public int getAvoirdupois() {
		return avoirdupois;
	}
	public void setAvoirdupois(int avoirdupois) {
		this.avoirdupois = avoirdupois;
	}
	public String getColor() {
		return Color;
	}
	public void setColor(String color) {
		Color = color;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	public void print(){
		System.out.println("宠物的自白：\n我的名字叫"+this.name+",我的健康值是"+this.health+",我和主人的亲密度是"+this.love+"。");
	}
}
